/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dca.sistemascontrole.malhadecontrole;

import dca.sistemascontrole.util.ControleConstantes;

/**
 *
 * @author Rafael
 */
public class MalhaFechada extends MalhaDeControle {

    private double setpoint;
    private String pv = ControleConstantes.TITULO_TANQUE_SUPERIOR;

    public MalhaFechada(double setpoint) {
        this.setpoint = setpoint;
    }

    @Override
    protected double getNextValue(long t, double nivelTanqueSuperior, double nivelTanqueInfeior) {
        double valor;
        if (pv.equals(ControleConstantes.TITULO_TANQUE_INFERIOR)) {
            valor = setpoint - nivelTanqueInfeior;
        }else{
            valor = setpoint - nivelTanqueSuperior;
        }
        return valor;
    }

    public double getSetpoint() {
        return setpoint;
    }

    public void setSetpoint(double setpoint) {
        this.setpoint = setpoint;
    }

    public String getPv() {
        return pv;
    }

    public void setPv(String pv) {
        this.pv = pv;
    }
}
